﻿using System.Data.Entity.ModelConfiguration;

namespace HobSoft.SoccerBet2014.Domain.Models.DbSchema
{
    public class TournamentConfiguration: EntityTypeConfiguration<Tournament>
    {
        public TournamentConfiguration(string schema = "dbo")
        {
            ToTable(schema + ".Tournament");
            HasKey(t => new { t.BmID, t.ID });
            Property(t => t.BmID).HasColumnName("BookerID").IsRequired();
            Property(t => t.ID).HasColumnName("TournamentID").IsRequired();
            Property(t => t.Name).HasColumnName("TournamentName").IsRequired().HasMaxLength(100);
            Ignore(t => t.Key);
        }
    }
}
